
//
//  timeFromte.m
//  MySQilst
//
//  Created by xujing on 16/7/26.
//  Copyright © 2016年 pangxiangyu. All rights reserved.
//

#import "timeFromte.h"

@implementation timeFromte
+(NSString * )inputFormatter:(NSString *)timeStr {
    
    NSString* string = timeStr;
    timeStr = [timeStr substringToIndex:14];
    NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init] ;
    [inputFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"] ];
    [inputFormatter setDateFormat:@"yyyyMMddHHmmss"];
    [inputFormatter setLocale:[NSLocale currentLocale]];
    NSDate* inputDate = [inputFormatter dateFromString:string];
    NSDateFormatter* df2 = [[NSDateFormatter alloc]init];
    [df2 setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString* dataStr1 = [df2 stringFromDate:inputDate];
    NSLog(@"date = %@", inputDate);
    return dataStr1;
    
    
}
@end
